import { IGraph } from './graph'

export interface ISquare extends IGraph {
  color?: string
}
// 单一职责原则

export class Square implements ISquare {
  long = 0
  width = 0
  color = ''
  constructor(width: number, color?: string) {
    this.width = this.long = width
    this.color = color
  }

  area() {
    return Math.pow(this.width, 2)
  }
}
